let mongoose = require('mongoose');
let config = require('../lib/config')

mongoose.connect(config.dbHost);

mongoose.connection.on('connecting',function () {
    console.log('database connection is starting!')
})

mongoose.connection.on('connected',function () {
    console.log('database connection is starting!')
})

mongoose.connection.on('error',function () {
    console.log('database connection is error!')
})

mongoose.connection.on('disconnected',function () {
    console.log('database connection is disconnected!')
})

module.exports = mongoose